/**
 * Created by mapbar_front on 2019/8/5.
 */
import React,{Component} from 'react';
import HocPublic from './../HocPublic';

const DataSource = {
    getBlogPost: function(){
        return 456;
    }
}

function TextBlog(props){
    return <div>
        {props.text}
    </div>
}

class HocblogPost extends Component{
    constructor(props){
        super(props);
        this.handleChange = this.handleChange.bind(this);
        this.state = {
            blogPost: DataSource.getBlogPost(props.id)
        }
    }
    componentDidMount(){

    }
    componentWillUnmount(){

    }
    handleChange(){
        this.setState({
            blogPost:DataSource.getBlogPost(this.props.id)
        })
    }
    render(){
        return(
            <div>
                <TextBlog text={this.state.blogPost}/>
            </div>
        )
    }
}
export default HocblogPost;
